//纯js的方式写Vue组件
import Vue from 'vue';
let compiledDom = Vue.compile(`<div>
<el-button @click="openDialog">compile方式弹出dialog</el-button>
<el-dialog :title="title" :visible.sync="showDialog">
    这是纯js写得Vue组件-compile方式弹出
    <span slot="footer" >
        <el-button @click="showDialog = false">取 消</el-button>
        <el-button type="primary" @click="showDialog = false">确 定</el-button>
    </span>
</el-dialog>
</div>`);

export default {
    props: {
        title: String,
    },
    data() {
        return {
            showDialog: false,
        }
    },
    methods: {
        openDialog() {
            console.log("openDialog")
            this.showDialog = true;
        }
    },
    render: compiledDom.render
}